package ide.ccf.ccproject.wizards.pages;

import ide.ccf.ccproject.managedbuilder.MbsCustomPageManager;
import ide.ccf.ccproject.managedbuilder.MbsWizardHandler;
import ide.ccf.ccproject.translate.Message;

import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;

public class ModulesWizardPage extends WizardPage {
	public static final String PAGE_ID = "ide.ccf.ccproject.wizards.pages.ModulesWizardPage"; 
	public boolean pagesLoaded = false;
	private MbsWizardHandler handler;
	private int selectedModules;
	private int requiredModules;

	public ModulesWizardPage(MbsWizardHandler mbsWizardHandler) {
		super(Message.ModulesWizard_0);
		setTitle(Message.ModulesWizard_0);
		setDescription(Message.ModulesWizard_1);
		handler = mbsWizardHandler;
		selectedModules = 0;
		requiredModules = 0;
		setWizard(mbsWizardHandler.getWizard());
	}

	public void createControl(Composite parent) {
		Composite c = new Composite(parent, SWT.NULL);
		c.setLayoutData(new GridData(GridData.FILL_BOTH));
		c.setLayout(new GridLayout(1, true));
		
		Label s = new Label(c, SWT.NONE);
		s.setText("注：此页需要添加库信息,暂时没有进行处理！");
		s.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
		setPageComplete(true);
		setControl(c);

	}
	
	@Override
	public IWizardPage getNextPage() {
		pagesLoaded = true;
		return MbsCustomPageManager.getNextPage(PAGE_ID);
	}
	
	/**
	 * 设置已选择模块
	 * @param mods
	 */
	public void setSelectedModules(int mods)
	{
		//TODO
	}
	
	/**
	 * 设置必须模块
	 * @param mods
	 */
	public void setRequiredModules(int mods)
	{
		//TODO
	}
	
	/**
	 * 获取所有模块
	 * @return
	 */
	public String getModules()
	{
		String modules = "";
		return modules;
	}

}
